/**
 *  JUnit testing for LoginController
 */

package source;

import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import org.junit.Test;

public class LoginControllerTest extends LoginController {

	/*public void setUpTest() {
		Map<String, String> user1values = new HashMap<String, String>();
		Map<String, String> user2values = new HashMap<String, String>();
		
		// create mock user#1 testUser/testPass
		user1values.put("username", "testUser");
		user1values.put("password", "testPass");
		
		// create mock user#2 testUser2/testPass2
		user2values.put("username", "testUser2");
		user2values.put("password", "testPass2");
		
		Patient testUser1 = (Patient) SystemAdministrator.addUser(user1values);
		Patient testUser2 = (Patient) SystemAdministrator.addUser(user2values);
	}
	
	@Test
	public void testCheckLogins() {
		
		setUpTest();
		testValidLogin();
		testInvalidLogin();
		testRandomLogin();
				
	}*/
	/*
	public boolean testValidLogin() {
		// username/password matches
		assertEquals(true, checkLogin(testuser1.get("username"), testuser1.get("password")));
	}
	
	public boolean testInvalidLogin() {	
		// username/password mis-match
		testcase2 = checkLogin(user1.get("username"), user2.get("password"));
		assertEquals(false, testcase2);
	}
	
	public boolean testRandomLogin() {
		// username and random password
		// create new random
		Random r = new Random();
		// convert to string
		String randomPass = Long.toString(Math.abs(r.nextLong()), 36);
		
		testcase3 = checkLogin(user1.get("username"), randomPass);
		assertEquals(false, testcase3);
		
		//fail("Not yet implemented");
	}
	 */
}
